<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:t="http://myfaces.apache.org/tomahawk">  

    <ui:composition>
        <t:dataTable id="tblCreditMemo" value="#{creditMemoBean.pageData}" var="cursor" styleClass="table table-hover"
                     preserveSort="true" rows="10" sortColumn="#{creditMemoBean.sort}" sortAscending="#{creditMemoBean.sortAscending}"
                     rowIndexVar="rowIndex" >
            <t:column>
                <f:facet name="header">
                </f:facet>
                <t:selectOneRow groupName="selectRadioGroup3" />
            </t:column>
            <t:column>
                <f:facet name="header">
                    <t:commandSortHeader columnName="ui.id" arrow="true" styleClass="sortColumn">
                        <h:outputText value="ID"/>
                    </t:commandSortHeader>
                </f:facet>
                <h:outputText value="#{cursor.ui.id}">
                </h:outputText>
            </t:column>
            <t:column>
                <f:facet name="header">
                </f:facet>
                <t:outputText value="#{(creditMemoBean.targetPage-1)*creditMemoBean.maximumPageSize +rowIndex+1}"/>
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="Chi/Thu"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.creditType}"/> 
            </t:column>

            <t:column>
                <f:facet name="header">
                    <h:outputText value="Giá Trị"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.amount}"> 
                    <f:convertNumber  type="currency" currencySymbol="₫"/>
                </h:outputText>
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="Lý Do"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.reason}"/> 
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="Ngày Tạo"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.createdDate}"/> 
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="Tạo Bởi"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.createdBy}"/> 
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="Sửa Bởi"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.modifiedBy}"/> 
            </t:column>
            <f:facet name="footer">
                <div class="row">
                    <div class="span6" style="padding-left: 30px">
                        <t:div styleClass="pagination pagination-left">
                            <ul>
                                <li>
                                    <t:commandLink><i class="icon-print"></i>In</t:commandLink>
                                </li>
                                <li>
                                    <t:commandLink  action="#{courseManageBean.preAddCredit}">Chi Thu</t:commandLink>
                                </li>
                                <li>
                                    <t:commandLink  action="#{courseManageBean.preUpdateCreditMemo}">Sửa</t:commandLink>
                                </li>
                                <li>
                                    <t:commandLink  action="#{courseManageBean.deleteCreditMemo}">Xóa</t:commandLink>
                                </li>

                            </ul>
                        </t:div>
                    </div>
                    <div class="span6">
                        <t:div styleClass="pagination pagination-right">
                            <ul>
                                <li>
                                    <t:commandLink  value="Previous"
                                                    disabled="#{!creditMemoBean.hasPreviousPage}"
                                                    action="#{creditMemoBean.previousPage}"/>
                                </li>

                                <li>
                                    <t:commandLink  value="Next"
                                                    disabled="#{!creditMemoBean.hasNextPage}"
                                                    action="#{creditMemoBean.nextPage}" />
                                </li>
                                <li class="active"> <a href="#"><t:outputText value="#{creditMemoBean.rowCount} row(s)"/></a>
                                </li>
                            </ul>
                        </t:div>
                    </div>
                </div>

            </f:facet>
        </t:dataTable>

    </ui:composition>        

</html>  